package DBAccess;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class SQLAccess {
	private Connection connecttion;
	private ConfigurationDB config = new ConfigurationDB();

	public Statement GetStatement() throws InstantiationException, IllegalAccessException {
		try {
			Class.forName(config.GetDriverName()).newInstance();
		} catch (ClassNotFoundException e) {
		}
		try {
			connecttion = DriverManager.getConnection(config.GetConnString(),
					config.GetUserName(), config.GetPassWord());
			return connecttion.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
		} catch (SQLException e) {
			return null;
		}
	}
}
